/*
 * c4_exercise9.cpp
 *
 *  Created on: Sep 1, 2013
 *      Author: cyper.yin
 */

#include <iostream>
using namespace std;

int main_c4e9(int argc, char **argv) {
	struct CandyBar {
		string brand;
		float weight;
		int calories;
	};

	CandyBar *p = new CandyBar[3];
	for (int i = 0; i < 3; ++i) {
		p[i].brand = "brand" + i;
		p[i].weight = i*10.2;
		p[i].calories = i;
	}

	for (int j = 0; j < 3; ++j) {
		cout << p[j].brand << endl;
		cout << p[j].weight << endl;
		cout << p[j].calories << endl << endl;
	}

	delete [] p;


	return 0;

}



